package com.annual.common.utils;


import com.annual.common.exception.ServiceException;
import org.springframework.lang.Nullable;

/**
 * @author kai
 * @date 2020/12/18 10:57
 */
public class Assert {


    public static void isTrue(boolean expression, String message) {
        if (expression) {
            throw new ServiceException(message);
        }
    }

    public static void notNull(@Nullable Object object, String message) {
        if (object == null) {
            throw new ServiceException(message);
        }
    }

}
